package com.itheima.d1_homework;

public abstract class  Animal {
    private String color;
    private  int leg;

    public abstract void eat();

    public Animal() {
    }

    public Animal(String color, int leg) {
        this.color = color;
        this.leg = leg;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getLeg() {
        return leg;
    }

    public void setLeg(int leg) {
        this.leg = leg;
    }
}
class Bear extends Animal{
    public Bear() {
    }

    public Bear(String color, int leg) {
        super(color, leg);
    }


    @Override
    public void eat() {
        System.out.println(getColor()+getLeg()+"条腿的北极熊吃蜂蜜");
    }
    public void catchFish(){
        System.out.println(getColor()+getLeg()+"条腿的北极熊抓鱼");
    }
}
class Panda extends  Animal{
    public Panda() {
    }

    public Panda(String color, int leg) {
        super(color, leg);
    }

    @Override
    public void eat() {
        System.out.println(getColor()+getLeg()+"条腿的大熊猫吃竹子");
    }
    public void climbTree(){
        System.out.println(getColor()+getLeg()+"条腿的大熊猫在爬树");
    }
}

